package fr.zadoka.zadokadna;

import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import fr.zadoka.zadokadna.ZadokaNavigationDrawer.ZadokaMenuEntry;

public class ActivitySwitcher {

	public static void switchTo(ActionBarActivity fromActivity,
								ZadokaMenuEntry selectedEntry) {
		Intent intent;
		switch(selectedEntry)
		{
		case Daily:
			if (fromActivity.getClass() == MainActivity.class)
				break;
			intent = new Intent(fromActivity, MainActivity.class);
			fromActivity.startActivity(intent);
			break;
		case Favorite:
			if (fromActivity.getClass() == FavoriteActivity.class)
				break;
			intent = new Intent(fromActivity, FavoriteActivity.class);
			fromActivity.startActivity(intent);
			break;
		case Settings:
			break;
		}
		
	}

}
